from django.db import models
from libs.models import BaseModel
# Create your models here.


class BannerModel(BaseModel):
    """轮播图"""
    name = models.CharField(verbose_name="图片名称", max_length=32)
    img = models.ImageField(verbose_name="轮播图", upload_to="banner", null=True,
                            help_text="大小必须为：3840*800", )
    link = models.CharField(verbose_name="跳转链接", max_length=32)
    info = models.TextField(verbose_name="图片信息")

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = "轮播图"
        verbose_name_plural = "所有轮播图"